package com.onlinelibrary.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class minioConfig {
    //minio的路径端口
    @Value("${minio.endpoint}")
    String endpoint;

    //minio的用户名
    @Value("${minio.credentialAccessKey}")
    String credentialAccessKey;

    //minio的密码
    @Value("${minio.credentialSecretKey}")
    String credentialSecretKey;

    @Bean
    public MinioClient minioClient(){
        return MinioClient.builder()
                .endpoint(endpoint)
                .credentials(credentialAccessKey,credentialSecretKey)
                .build();
    }

}
